using System.Collections.Generic;

namespace Voodoo.Sauce.Internal.Analytics
{
	public class VoodooFunnel
	{
		private readonly Dictionary<string, int> _stepsDict = new Dictionary<string, int>();

		public bool HasStepName(string stepName)
		{
			return _stepsDict.ContainsKey(stepName);
		}

		public int GetStepPosition(string stepName)
		{
			return _stepsDict[stepName];
		}

		public VoodooFunnel(VoodooFunnelSettings voodooFunnelSettings)
		{
			VoodooFunnelStepSettings[] steps = voodooFunnelSettings.steps;
			foreach (VoodooFunnelStepSettings voodooFunnelStepSettings in steps)
			{
				_stepsDict.Add(voodooFunnelStepSettings.stepName, voodooFunnelStepSettings.stepPosition);
			}
		}
	}
}
